<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      .k-dialog {
        width: 30%;
        z-index: 2001;
        display: block;
        position: absolute;
        background: #fff;
        border-radius: 2px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        margin: 0 auto;
        top: 15vh;
        left: 30%;
      }

      .k-wrapper {
        position: fixed;
        left: 0px;
        top: 0px;
        bottom: 0px;
        right: 0px;
        background: black;
        opacity: 0.4;
        z-index: 2000;
      }

      .k-header {
        padding: 20px 20px 10px;
      }

      .k-header .k-title {
        line-height: 24px;
        font-size: 18px;
        color: #303133;
        float: left;
      }

      .k-body {
        padding: 30px 20px;
        color: #606266;
        font-size: 14px;
      }

      .k-footer {
        padding: 10px 20px 30px;
        text-align: right;
      }

      .k-close {
        color: #909399;
        font-weight: 400;
        float: right;
        cursor: pointer;
      }

      .k-cancel {
        color: #606266;
        border: 1px solid #dcdfe6;
        text-align: center;
        cursor: pointer;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 4px;
        font-weight: 500;
        margin-right: 10px;
      }

      .k-cancel:hover {
        color: #409eff;
        background: #ecf5ff;
        border-color: #c6e2ff;
      }

      .k-primary {
        border: 1px solid #dcdfe6;
        text-align: center;
        cursor: pointer;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 4px;
        font-weight: 500;
        background: #409eff;
        color: #fff;
        margin-left: 10px;
      }

      .k-primary:hover {
        background: #66b1ff;
      }
      .k-input {
        width: 100%;
        margin-left: 20px;
        margin-bottom: 20px;
      }
      .input-inner {
        -webkit-appearance: none;
        background-color: #fff;
        background-image: none;
        border-radius: 4px;
        border: 1px solid #dcdfe6;
        box-sizing: border-box;
        color: #606266;
        display: inline-block;
        font-size: inherit;
        height: 40px;
        line-height: 40px;
        outline: none;
        padding: 0 15px;
        transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
        width: 100%;
        margin-top: 20px;
      }
    </style>
  </head>

  <body>
    <!-- <div class="k-wrapper"></div>
    <div class="k-dialog">
        <div class="k-header">
            <span class="k-title">提示</span><span class="k-close">X</span>
        </div>
        <div class="k-body">
            <span>这是一段文本</span>
            <input class="input-inner" type="text" />
        </div>
        <div class="k-footer">
            <span class="k-cancel">取消</span>
            <span class="k-primary">确定</span>
        </div>
    </div> -->
    <!-- <button class="btn1">点击1</button>
    <button class="btn2">点击2</button> -->
    <my-dailog title="我的标题外部" content="内容">
      <!-- <div>nihao</div> -->
    </my-dailog>
  </body>
  <script type="module">
    import Dailog, { ExtendsDailog } from "./dailog.js";
    document.querySelector("my-dailog").addEventListener("success", (e) => {
      console.log("点击了确定");
    });
    // // let vm = new Vue()
    // let dailog = new Dailog({
    //     width: "40%",
    //     height:"260px",
    //     title:"我的标题",
    //     content:"我的内容",
    //     maskable: true,
    //     isCancel: true,
    //     dragable: true,
    //     success(e){
    //         console.log("点击了确定",e.detail);
    //     },
    //     cancel(val){
    //         console.log("值是:",val);
    //     }
    // })
    // document.querySelector(".btn1").onclick = function(){
    //     dailog.open();
    // }

    // let dailog2 = new ExtendsDailog({
    //     width: "40%",
    //     success(e){
    //         console.log("点击了确定",e.detail);
    //     },
    //     cancel(){
    //         console.log("值是:");
    //     }
    // })
    // document.querySelector(".btn2").onclick = function(){
    //     dailog2.open();
    // }
  </script>
</html>
